package test_kevin;

import java.io.File;

import javax.swing.Icon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import javax.swing.filechooser.FileSystemView;

public class IconExtract2 {
    public static void main(String[] args) throws Exception {
      String s = "C:\\Users\\kevda\\Music\\Loituma - Ieva's polka_ Ievan Polkka good sound.mp3";
      File file = new File(s);

      // Get metadata and create an icon
      Icon icon = FileSystemView.getFileSystemView().getSystemIcon(file);

      // show the icon
      JLabel ficon = new JLabel(s, icon, SwingConstants.LEFT);

      JFrame frame = new JFrame();
      frame.getContentPane().add(ficon);
      frame.pack();
      frame.setVisible(true);
    }
  }